#-------------------------------------------------------------------------------
# Copyright (c) 2020-2021, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------
cmake_policy(SET CMP0079 NEW)

add_library(tfm_app_rot_partition_core_test_2 STATIC)

target_sources(tfm_app_rot_partition_core_test_2
    PRIVATE
        tfm_ss_core_test_2.c
)

# The generated sources
target_sources(tfm_app_rot_partition_core_test_2
    PRIVATE
        $<$<BOOL:${TFM_PSA_API}>:
            ${CMAKE_BINARY_DIR}/generated/test_services/tfm_core_test_2/auto_generated/intermedia_tfm_ss_core_test_2.c>
)

target_sources(tfm_partitions
    INTERFACE
        $<$<BOOL:${TFM_PSA_API}>:
            ${CMAKE_BINARY_DIR}/generated/test_services/tfm_core_test_2/auto_generated/load_info_tfm_ss_core_test_2.c>
)

# Set include directory
target_include_directories(tfm_app_rot_partition_core_test_2
    PUBLIC
        .
    PRIVATE
        ${CMAKE_BINARY_DIR}/generated/test_services/tfm_core_test_2
)

target_include_directories(tfm_partitions
    INTERFACE
        ${CMAKE_BINARY_DIR}/generated/test_services/tfm_core_test_2
)

target_link_libraries(tfm_app_rot_partition_core_test_2
    PRIVATE
        tfm_secure_api
        psa_interface
        platform_s
        tfm_psa_rot_partition_core_test
        tfm_arch
)

target_link_libraries(tfm_spm
    PRIVATE
        tfm_app_rot_partition_core_test_2
)

############################ Partition Defs ####################################

target_link_libraries(tfm_partitions
    INTERFACE
        tfm_app_rot_partition_core_test_2
)

target_compile_definitions(tfm_partition_defs
    INTERFACE
        TFM_PARTITION_TEST_CORE
)
